//权限判断函数库
import {
    LEAVE_APPLY,
    LEAVE_APPROVAL,
    READ_AWARD_MESSAGE,
    READ_INSTRUCTOR,
    READ_MESSAGE,
    READ_UNIT,
    READ_UNIT_HUMAN,
    READ_UPDATE_AWARD,
    OPINION_VIEW,
    OPINION_APPLY,
    COMPLEX_APPROVAL,
    PHOTO_MANAGE,
    LOG,
    EVENT,
    ACTIVITY,
    READ_ALL_AWARD_MESSAGE,
    NEWS,
    Notices,
    Construction,
    FeedbackHandle,
    UNIT_MANAGE,
    COMPLEX_VIEW,
    COMPLEX_COMMITTEE,
    AllProjectMessage,
    AllFieldworkMessage
} from "@/util/config.js";


//学生信息
export const readMessage = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (READ_MESSAGE.includes(item)) {
            flag = true
        }
    }
    return flag
}


//上传奖惩罚、竞赛信息
export const readUpdateAward = (roleNo) => {
    let flag = false

    for (let item of roleNo) {
        if (READ_UPDATE_AWARD.includes(item)) {
            flag = true
        }
    }
    return flag
}

//奖惩信息
export const readAwardMessage = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (READ_AWARD_MESSAGE.includes(item)) {
            flag = true
        }
    }
    return flag
}
// 全部奖惩信息
export const readAllAwardMessage = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (READ_ALL_AWARD_MESSAGE.includes(item)) {
            flag = true
        }
    }
    return flag
}

//辅导员
export const readInstructor = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (READ_INSTRUCTOR.includes(item)) {
            flag = true
        }
    }
    return flag
}

//部门信息
export const readUnit = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (READ_UNIT.includes(item)) {
            flag = true
        }
    }
    return flag
}

//部门管理
export const readUnitHuman = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (READ_UNIT_HUMAN.includes(item)) {
            flag = true
        }
    }
    return flag
}
export const unitManage = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (UNIT_MANAGE.includes(item)) {
            flag = true
        }
    }
    return flag
}

//请假申请
export const leaveApply = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (LEAVE_APPLY.includes(item)) {
            flag = true
        }
    }
    return flag
}


//请假批准
export const leaveApproval = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (LEAVE_APPROVAL.includes(item)) {
            flag = true
        }
    }
    return flag
}

// 意见反馈
export const opinionApply = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (OPINION_APPLY.includes(item)) {
            flag = true
        }
    }
    return flag
}

// 意见查看
export const opinionView = (roleNo) =>{
    let flag = false
    for (let item of roleNo) {
        if (OPINION_VIEW.includes(item)) {
            flag = true
        }
    }
    return flag
}

//综测审批COMPLEX_VIEW
export const complexApproval = (roleNo) =>{
    let flag = false
    for (let item of roleNo) {
        if (COMPLEX_APPROVAL.includes(item)) {
            flag = true
        }
    }
    return flag
}
// 综测班委
export const complexCommittee = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (COMPLEX_COMMITTEE.includes(item)) {
            flag = true
        }
    }
    return flag
}

//综测查看
export const complexView = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (COMPLEX_VIEW.includes(item)) {
            flag = true
        }
    }
    return flag
}

// 照片管理
export const photoManage = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (PHOTO_MANAGE.includes(item)) {
            flag = true
        }
    }
    return flag
}
// 查看日志
export const log = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (LOG.includes(item)) {
            flag = true
        }
    }
    return flag
}
// 能否发布活动
export const activity = (roleNo) =>{
    let flag = false
    for (let item of roleNo) {
        if (ACTIVITY.includes(item)) {
            flag = true
        }
    }
    return flag
}
//大事管理
export const event_manage = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (EVENT.includes(item)) {
            flag = true
        }
    }
    return flag
}
//新闻编辑
export const newsEdit = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (NEWS.includes(item)) {
            flag = true
        }
    }
    return flag
}
//通知管理
export const noticesEdit = (roleNo)=>{
    let flag = false
    for (let item of roleNo) {
        if (Notices.includes(item)) {
            flag = true
        }
    }
    return flag
}
//学院党团建
export const construct = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (Construction.includes(item)) {
            flag = true
        }
    }
    return flag
}
// 意见反馈查看
export const feedbackHandle = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (FeedbackHandle.includes(item)) {
            flag = true
        }
    }
    return flag
}
// 综测查看
export const complexHandle = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (Complex.includes(item)) {
            flag = true
        }
    }
    return flag
}
export const ProjectMessage = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (AllProjectMessage.includes(item)) {
            flag = true
        }
    }
    return flag
}
export const FieldworkMessage = (roleNo) => {
    let flag = false
    for (let item of roleNo) {
        if (AllFieldworkMessage.includes(item)) {
            flag = true
        }
    }
    return flag
}
